<template>
	<view class="page">
		<view class="page-title">{{detail.title}}</view>
		<view class="page-content">
			<u-parse :content="detail.descn"></u-parse>
		</view>
	</view>
</template>

<script>
	import { mapGetters } from 'vuex'
	export default {
		data() {
			return {
				detail: {}
			}
		},
		computed: {
			...mapGetters(['openId']),
		},
		onLoad(option) {
			this.detail.id = option.id
			this.getDBDetail()
		},
		methods: {
			async getDBDetail() {
				let params = {
					id: this.detail.id,
					openId: this.openId,
				}
				let res = await this.$api.getNewsDetail(params)
				if (res.success) {
					this.detail = res.result
					console.log('系统消息详情：', res.result);
				} else {
					uni.showToast({ title: res.message || '获取详情失败！', icon: 'none' });
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background-color: #F7F8FA;
	}

	.page {
		padding-bottom: constant(safe-area-inset-bottom);
		padding-bottom: env(safe-area-inset-bottom);
	}

	.page-title {
		padding: 32rpx;
		font-size: 32rpx;
		font-weight: 600;
		color: #1D2129;
		line-height: 48rpx;
		text-align: center;
	}

	.page-content {
		padding: 0 32rpx;
		font-size: 28rpx;
		color: #1D2129;
	}
</style>